import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Food from '@/components/Food'
import Order from '@/components/Order'
import Login from '@/components/Login'
import Find from '@/components/Find'
import Personal from '@/components/Personal'
import Shop from '@/components/Shop'
import Info from '@/components/Info'
import Search from '@/components/Search'
import SearchShop from '@/components/SearchShop'
import Pingjia from '@/components/Pingjia'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      components: {
        index: Home
      }
    },
    {
      path: '/food',
      name: 'food',
      components: {
        others: Food
      }
    },
    {
      path: '/order',
      name: 'order',
      components: {
        others: Order
      }
    },
    {
      path: '/shop',
      name: 'shop',
      components: {
        others: Shop
      }
    },
    {
      path: '/login',
      name: 'login',
      components: {
        others: Login
      }
    },
    {
      path: '/discover',
      name: 'Find',
      component: Find
    },
    {
      path: '/personal',
      name: 'Personal',
      component: Personal
    },
    {
      path: '/personal/info',
      name: 'Info',
      component: Info
    },
    {
      path: '/search',
      name: 'Search',
      component: Search
    },
    {
      path: '/search/shop',
      name: 'SearchShop',
      component: SearchShop
    },
    {
      path: '/pingjia',
      name: 'Pingjia',
      component: Pingjia
    },
    {
      path: '*',
      redirect: '/'
    }
  ]
})
